package com.by.remote;

import com.by.bean.Goods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author ServivE
 * @version 0.1
 * @className GoodsRemoteClient
 * @description
 * @date 2024/10/30 17:16
 * @since jdk17
 */
@FeignClient(value = "sc-goods")
public interface GoodsRemoteClient {
    /**
     * 更新库存
     * @param goodsId
     * @param num
     * @return
     */
    @GetMapping("/goods")
    String update(@RequestParam("goodsId") int goodsId, @RequestParam("num") int num);

    /**
     * 更新库存
     * @return
     */
    @GetMapping("/goods/entity")
    String updateEntity(@RequestParam Map map);

    /**
     * 获取商品详情
     * @param id
     * @return
     */
    @GetMapping("/goods/{id}")
    Map get(@PathVariable("id") int id);

    @PostMapping("/goods")
    int save(@RequestBody Goods goods);
}

